#!/bin/sh

adduser -D -g '' elasticsearch
adduser elasticsearch sudo
chown -R elasticsearch /usr/share/elasticsearch

# allow for memlock
# ulimit -l unlimited

# run
#/usr/share/elasticsearch/bin/elasticsearch

sudo -E -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch

echo server started.